import numpy as np
import torch
from torch import nn
from torch.autograd import Variable
from torch.utils.data import DataLoader


class bp_net(nn.Module):
    def __init__(self,input_num,hidden_num1,hidden_num2,hidden_num3,output_num):
        super().__init__()
        self.layer1 = nn.Linear(input_num,hidden_num1)

        self.layer2 = nn.Tanh()

        self.layer3 = nn.Linear(hidden_num1,hidden_num2)

        self.layer4 = nn.Linear(hidden_num2,hidden_num3)

        self.layer5 = nn.Linear(hidden_num3,output_num)

    def data_tf(x):
        x = np.array(x,dtype='float32')/4000
        x = (x-0.5)/0.5
        x = torch.from_numpy(x)
        return x
        

    def forward(self,x):
        x1 = self.layer1(x)
        x1 = self.layer2(x1)
        x1 = self.layer3(x1)
        x1 = self.layer2(x1)
        x1 = self.layer4(x1)
        x1 = self.layer2(x1)
        x1 = self.layer5(x1)
        return x1



    




